package com.qf.service.impl;

import com.qf.entity.Classsify;
import com.qf.entity.Dept;
import com.qf.entity.Role;
import com.qf.mapper.DeptMapper;
import com.qf.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 2019/12/10
 * 郭程鹏
 * springboot_oa_five
 * 面向代码面向君,不负时光不负卿
 */
@Service
public class DeptServiceImpl implements DeptService {

    //部门
    @Resource
    private DeptMapper deptMapper;
    @Override
    public List<Dept> findAllDept() {
        List<Dept> allDept = deptMapper.findAllDept();
        return allDept;
    }

    //职位
    @Override
    public List<Classsify> findClasssify() {
        List<Classsify> classsify = deptMapper.findClasssify();
        return classsify;
    }

    //角色
    @Override
    public List<Role> findRoles() {
        List<Role> roles = deptMapper.findRoles();
        return roles;
    }

    @Override
    public Dept InfoById(Integer deptId) {

        Dept dept = deptMapper.selectByPrimaryKey(deptId);
        return dept;
    }
}
